import request from '@/utils/request'

/**
 * @description 获取商品详情
 * @param {*} id
 * @return {*}
 */
export const getDetail = (id) => {
  return request.get('/goods', {
    params: {
      id
    }
  })
}

/**
 * @description 获取热榜商品
 * @param {*} id - 商品id
 * @param {*} type - 1代表24小时热销榜 2代表周热销榜
 * @param {*} limit - 获取个数
 * @return {*}
 */
export const getHotGoodsAPI = ({id, type, limit = 3}) => {
  return request.get('/goods/hot', {
    params: {
      id,
      type,
      limit
    }
  })
}
